blob: 70e7ebdb38119cec1aa06bf1d21be1d172cfa3d4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import getRates from "$lib/rates";
import { get } from "$lib/utils";
export async function load({ depends, parent }) {
depends("app:user");
const rates = await getRates();
const { subject, user } = await parent();
const { follows, followers } = await get(`/${subject.pubkey}/count`);
let followList = new Promise((r) => r([]));
if (user)
followList = get(`/${user.pubkey}/follows?pubkeysOnly=true`).catch(
() => [],
);
return { follows, followers, followList, rate: rates[subject.currency] };
}
|